<!DOCTYPE html>
<html>
<head>
    <title>显示全屏</title>
    <meta charset="utf-8">
    <script language="javascript" type="text/javascript" src="./jQuery/jquery-1.7.1.js"></script>
    <link href="./CSS/canvas.css" rel="stylesheet" type="text/css">
</head>

<body>
    <canvas id="myCanvas">browser not support</canvas>
</body>
<script type="text/javascript">
    resizeCanvas();
    $(window).resize(resizeCanvas);

    function resizeCanvas()
    {
    var canvas = $("#myCanvas");
    var context = canvas.get(0).getContext("2d");

    canvas.attr("width",$(window).get(0).innerWidth);
    canvas.attr("height",$(window).get(0).innerHeight);
    context.fillRect(0,0,canvas.width(),canvas.height());
    }
//    alert("3");
</script>
</html>